package com.chhuang.ewcrm.controller;

import com.chhuang.ewcrm.entity.EWarehouse;
import com.chhuang.ewcrm.service.EWarehouseService;
import com.chhuang.ewcrm.vo.ResultBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author chhuang
 * @create 2020-11-16-13:51
 */
@RestController
@RequestMapping("wapi/warehouse")
public class WWarehouseController {
    Logger logger= LoggerFactory.getLogger(WWarehouseController.class);
    /**
     * 服务对象
     */
    @Resource
    private EWarehouseService eWarehouseService;

    /**
     * 获取所有仓库
     *
     * @return 单条数据
     */
    @GetMapping("/getAll")
    public ResultBean<List<EWarehouse>> getAll() {
        ResultBean<List<EWarehouse>> resultBean = new ResultBean<>();
        resultBean.setSuccess(true);
        resultBean.setData(this.eWarehouseService.query(null, "create_time"));
        return resultBean;
    }

}
